Why does [NSOutlineView clickedRow] always return -1?
        Posted  
        
            by jxpx777
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by jxpx777
        
        
        
        Published on 2010-05-11T19:49:31Z
        Indexed on 
            2010/05/11
            19:54 UTC
        
        
        Read the original article
        Hit count: 473
        
I have a fairly pedestrian non-editable NSOutlineView setup. In the bindings for the outline view, I have set the binding to my file's owner (MyDocument FWIW) with a selector of outlineViewWasDoubleClicked
The method exists and is called, but when I call -clickedRow it consistently returns -1 rather than the row number of the row that I double clicked to trigger the method.
My _outlineView is an IBOutlet and I've verified that it is hooked up correctly by using -selectedRow for the method rather than -clickedRow (I would rather use -clickedRow though because it seems unintuitive for the user to have a row selected, double click another row to do something with it and have the method triggered with the row they had selected.)
My best guess right now is that the -clickedRow value is getting cleared out before my method fires, but I don't know where or what might be gobbling it up.
Thanks in advance for any help.
© Stack Overflow or respective owner